/*
#include <stack>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
void combineChild(vector<vector<int>>&result,vector<int>& nums,vector<int>pre,int k,int index){
	if(k==0){
		result.push_back(pre);
	}
	for(int i=index;i<nums.size();i++){
		if(i!=index&&nums[i]==nums[i-1])
			continue;
		pre.push_back(nums[i]);
		combineChild(result,nums,pre,k-1,i+1);
		pre.pop_back();
	}
}
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
	sort(nums.begin(),nums.end());
	vector<int>pre;
	vector<vector<int>>result;
	result.push_back(pre);
	for(int i=1;i<=nums.size();i++){
		pre.clear();
		combineChild(result,nums,pre,i,0);
	}
	return result;
}
int main(){
	int a[]={1,2,2};
	vector<int> nums1(a,a+sizeof(a)/sizeof(int));
	subsetsWithDup(nums1);
	cout<<endl;
	system("pause");
}
*/